cmake_minimum_required(VERSION 3.3...3.12 FATAL_ERROR)

project(QtVTKRenderWindows)

find_package(VTK REQUIRED)

#if (CMAKE_BUILD_TYPE STREQUAL "Debug")
#    # this can debug properly
#    set (EXECUTABLE_OUTPUT_PATH ${VTK_DIR}/bin/Debug)
#endif()


# Set your files and resources here
set( Srcs QtVTKRenderWindowsApp.cxx QtVTKRenderWindows.cxx)

set( Hdrs QtVTKRenderWindows.h )

set( MOC_Hdrs QtVTKRenderWindows.h )

set( UIs QtVTKRenderWindows.ui )

include_directories(
  ${CMAKE_CURRENT_BINARY_DIR}
  ${CMAKE_CURRENT_SOURCE_DIR}
)

# Instruct CMake to run moc automatically when needed.
set(CMAKE_AUTOMOC ON)

find_package(Qt5 COMPONENTS Widgets REQUIRED QUIET)
qt5_wrap_ui(UI_Srcs ${UIs})

# CMAKE_AUTOMOC in ON so the MocHdrs will be automatically wrapped.
add_executable(QtVTKRenderWindowsApp ${Srcs} ${Hdrs} ${UI_Srcs} ${MOC_Hdrs})
target_link_libraries(QtVTKRenderWindowsApp Qt5::Core Qt5::Gui Qt5::Widgets)
message("VTK_LIBRARIES = ${VTK_LIBRARIES}")
target_link_libraries(QtVTKRenderWindowsApp ${VTK_LIBRARIES})
